<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>生成流量展示</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-image: url('static/background.png');
            background-size: cover;
            background-position: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
         }
         header {
             width: 100%;
             background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
             padding: 10px 0;
             text-align: center;
             position: fixed;
             top: 0;
             left: 0;
             z-index: 1000;
         }
         nav ul {
             list-style-type: none;
             padding: 0;
             display: flex;
             justify-content: center;
         }
         nav ul li {
             margin: 0 15px;
         }
         nav ul li a {
             text-decoration: none;
             color: black;
             font-weight: bold;
         }
         nav ul li a:hover {
             color: rgb(85, 153, 222);
         }
         main {
             max-width: 800px;
             margin: 70px 20px; /* 调整上边距以避免被导航栏遮挡 */
             text-align: center;
             background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
             padding: 20px;
             border-radius: 10px;
             overflow-y: auto; /* 允许内容区域滚动 */
         }
         main h1 {
             font-size: 2em;
         }
         main p {
             line-height: 1.6;
         }
         footer {
             width: 100%;
             background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
             padding: 10px 0;
             text-align: center;
             position: fixed;
             bottom: 0;
             left: 0;
             z-index: 1000;
         }
         .button {
            display: block;
            width: 95%;
            padding: 10px;
            margin-top: 10px;
            border: 2px solid #007BFF; /* 蓝色边框 */
            border-radius: 5px;
            text-decoration: none;
            color: white; /* 白色文本 */
            font-weight: bold;
            background-color: #007BFF; /* 蓝色背景 */
            transition: background-color 0.3s, color 0.3s; /* 平滑颜色变化 */
        }
        .button:hover {
            background-color: #0056b3; /* 深蓝色背景 */
            color: #ffffff; /* 白色文本 */
        }
         table {
             width: 100%;
             border-collapse: collapse;
             margin-top: 20px;
         }
         th, td {
             border: 1px solid #ddd;
             padding: 8px;
         }
         th {
             background-color: #f2f2f2;
         }
    </style>
</head>
<body>
    <header>
        <nav>
            <ul>
                <li><a href="/index">首页</a></li>
                <li><a href="/introduction">系统介绍</a></li>
                <li><a href="/perturbation">参数设置</a></li>
                <li><a href="/generate">流量生成</a></li>
                <li><a href="/detect">检测测试</a></li>
            </ul>
        </nav>
    </header>
    <main>
        <h1>生成流量展示</h1>
        <div>
            <p>当前扰动强度 (ξ): {{ perturbation_strength }}</p>
            <p>对抗损失权重 (α): {{alpha}}</p>
            <p>生成器学习率 (β): {{beta}}</p>
            <p>判别器学习率 (ζ): {{zeta}}</p>
            <p>动量因子 (μ): {{mu}}</p>
            <p>集成模型学习率 (ε): {{epsilon}}</p>
            <h2>对抗样本数据表</h2>
            <table>
                <thead>
                    <tr>
                        <th>样本索引</th>
                        <th>duration</th>
                        <th>protocol_type_icmp</th>
                        <th>protocol_type_tcp</th>
                        <th>protocol_type_udp</th>
                        <th>service_IRC</th>
                        <th>service_X11</th>
                        <th>service_Z39_50</th>
                        <th>service_auth</th>
                        <th>service_bgp</th>
                        <th>service_courier</th>
                        <th>service_csnet_ns</th>
                        <th>service_ctf</th>
                        <th>service_daytime</th>
                        <th>service_discard</th>
                        <th>service_domain</th>
                        <th>service_domain_u</th>
                        <th>service_echo</th>
                        <th>service_eco_i</th>
                        <th>service_ecr_i</th>
                        <th>service_efs</th>
                        <th>service_exec</th>
                        <th>service_finger</th>
                        <th>service_ftp</th>
                        <th>service_ftp_data</th>
                        <th>service_gopher</th>
                        <th>service_hostnames</th>
                        <th>service_http</th>
                        <th>service_http_443</th>
                        <th>service_imap4</th>
                        <th>service_iso_tsap</th>
                        <th>service_klogin</th>
                        <th>service_kshell</th>
                        <th>service_ldap</th>
                        <th>service_link</th>
                        <th>service_login</th>
                        <th>service_mtp</th>
                        <th>service_name</th>
                        <th>service_netbios_dgm</th>
                        <th>service_netbios_ns</th>
                        <th>service_netbios_ssn</th>
                        <th>service_netstat</th>
                        <th>service_nnsp</th>
                        <th>service_nntp</th>
                        <th>service_ntp_u</th>
                        <th>service_other</th>
                        <th>service_pm_dump</th>
                        <th>service_pop_2</th>
                        <th>service_pop_3</th>
                        <th>service_printer</th>
                        <th>service_private</th>
                        <th>service_red_i</th>
                        <th>service_remote_job</th>
                        <th>service_rje</th>
                        <th>service_shell</th>
                        <th>service_smtp</th>
                        <th>service_sql_net</th>
                        <th>service_ssh</th>
                        <th>service_sunrpc</th>
                        <th>service_supdup</th>
                        <th>service_systat</th>
                        <th>service_telnet</th>
                        <th>service_tftp_u</th>
                        <th>service_tim_i</th>
                        <th>service_time</th>
                        <th>service_urh_i</th>
                        <th>service_urp_i</th>
                        <th>service_uucp</th>
                        <th>service_uucp_path</th>
                        <th>service_vmnet</th>
                        <th>service_whois</th>
                        <th>flag_OTH</th>
                        <th>flag_REJ</th>
                        <th>flag_RSTO</th>
                        <th>flag_RSTOS0</th>
                        <th>flag_RSTR</th>
                        <th>flag_S0</th>
                        <th>flag_S1</th>
                        <th>flag_S2</th>
                        <th>flag_S3</th>
                        <th>flag_SF</th>
                        <th>flag_SH</th>
                        <th>src_bytes</th>
                        <th>dst_bytes</th>
                        <th>land</th>
                        <th>wrong_fragment</th>
                        <th>urgent</th>
                        <th>hot</th>
                        <th>num_failed_logins</th>
                        <th>logged_in</th>
                        <th>num_compromised</th>
                        <th>root_shell</th>
                        <th>su_attempted</th>
                        <th>num_root</th>
                        <th>num_file_creations</th>
                        <th>num_shells</th>
                        <th>num_access_files</th>
                        <th>num_outbound_cmds</th>
                        <th>is_host_login</th>
                        <th>is_guest_login</th>
                        <th>count</th>
                        <th>srv_count</th>
                        <th>serror_rate</th>
                        <th>srv_serror_rate</th>
                        <th>rerror_rate</th>
                        <th>srv_rerror_rate</th>
                        <th>same_srv_rate</th>
                        <th>diff_srv_rate</th>
                        <th>srv_diff_host_rate</th>
                        <th>dst_host_count</th>
                        <th>dst_host_srv_count</th>
                        <th>dst_host_same_srv_rate</th>
                        <th>dst_host_diff_srv_rate</th>
                        <th>dst_host_same_src_port_rate</th>
                        <th>dst_host_srv_diff_host_rate</th>
                        <th>dst_host_serror_rate</th>
                        <th>dst_host_srv_serror_rate</th>
                        <th>dst_host_rerror_rate</th>
                        <th>dst_host_srv_rerror_rate</th>
                    </tr>
                </thead>
                <tbody>
                    {% for sample in fake_samples %}
                    <tr>
                        <td>{{ loop.index }}</td>
                        {% for feature in sample %}
                        <td>{{ feature }}</td>
                        {% endfor %}
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        <a href="{{ url_for('detect', strength=strength) }}" class="button">检测流量</a>
    </main>
    <footer>
        <p>&copy; 2025 恶意流量生成系统</p>
    </footer>
</body>
</html>